package com.wan.core.shutdown;

/**
 * @author wwh
 * @date 2022/6/27 10:30
 */
public class Shutdown {
    /** 名字 */
    private final String name;
    /** 优先级,值越大越先执行 */
    private final int priority;
    /** 任务 */
    private final Runnable runnable;

    public Shutdown(String name, int priority, Runnable runnable) {
        this.name = name;
        this.priority = priority;
        this.runnable = runnable;
    }

    public int getPriority() {
        return priority;
    }

    public Runnable getRunnable() {
        return runnable;
    }

    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return "Shutdown{" +
                "name='" + name + '\'' +
                ", priority=" + priority +
                '}';
    }
}
